﻿using System.Text;

namespace CST_276_Lab_3
{
    public class MetalDesk : Desk
    {

        #region Members
        private readonly IComponentFactory _componentFactory;
        #endregion

        #region Methods

        public MetalDesk(IComponentFactory componentFactory)
        {
            this._componentFactory = componentFactory;
        }

        public override string Prepare()
        {
            MonitorStand = _componentFactory.CreateMonitorStand();
            Bracket = _componentFactory.CreateBracket();
            KeyboardTray = _componentFactory.CreateKeyboardTray();
            MouseTray = _componentFactory.CreateMouseTray();
            Elevator = _componentFactory.CreateElevator();
            Drawers = _componentFactory.CreateDrawers();
            Shelves = _componentFactory.CreateShelves();

            var sb = new StringBuilder();
            sb.Append("Preparing " + Name + "...\n");
            sb.Append(MonitorStand.GetDescription() + "\n");
            sb.Append(Bracket.GetDescription() + "\n");
            sb.Append(KeyboardTray.GetDescription() + "\n");
            sb.Append(MouseTray.GetDescription() + "\n");
            sb.Append(Elevator.GetDescription() + "\n");
            sb.Append(Drawers.GetDescription() + "\n");
            sb.Append(Shelves.GetDescription() + "\n");

            return sb.ToString();
        }

        #endregion

    }
}
